﻿@{
    ViewBag.Title = "Listar";
    Layout = "~/Views/Shared/_LayoutAdministrador.cshtml";
}
@model IEnumerable<Cliente_DozenContext.Cliente_DetallePlanContratado>

<h2>Listar</h2>
<div>
@{ 
    GridEditMode mode = (GridEditMode)ViewData["mode"];
    GridButtonType type = (GridButtonType)ViewData["type"];  
            @(Html.Telerik().Grid(Model)
                    .Name("Grid")
                                    .ToolBar(commands => commands.Insert().ButtonType(type).ImageHtmlAttributes(new { style = "margin-left:0" }))

                    .Columns(columns =>
                    {
                        columns.Bound(o => o.Cliente_ClienteCod);
                        columns.Bound(o => o.Cliente_Cliente.Cliente_ClienteNombre);
                        columns.Bound(o => o.Cliente_Cliente.Cliente_ClienteApellidos);
                        columns.Bound(o => o.Cliente_Cliente.Cliente_ClienteFechaNacimiento);

                        columns.Command(commands =>
                        {
                            commands.Edit();
                            commands.Delete();
                        });


                    })
                    .DataBinding(dataBinding => dataBinding.Server()
                            .Select("listar", "Cliente", new { mode = mode, type = type })
                                    .Insert("Insert", "Cliente", new { mode = mode, type = type })
                            .Update("Save", "Cliente", new { mode = mode, type = type })
                            .Delete("Delete", "Cliente", new { mode = mode, type = type }))
                    .DataKeys(keys => keys.Add(m => m.Cliente_ClienteCod))
                    .Scrollable(scrolling => scrolling.Enabled(true))
                    .Pageable(paging => paging.Enabled(true))
                    .Editable(editing => editing.Mode(mode))

                    .Footer(true)
                            .Filterable()


            ) 

    }
<div>